<?php $objClienteBO = $request->getAttribute('objClienteBO') ? $request->getAttribute('objClienteBO') : new ClienteBO(); ?>
<?php $arrayUf = array("AC" => "AC",
                               "AL" => "AL",
                               "AP" => "AP",
                               "AM" => "AM",
                               "BA" => "BA",
                               "CE" => "CE",
                               "DF" => "DF",
                               "ES" => "ES",
                               "GO" => "GO",
                               "MA" => "MA",
                               "MT" => "MT",
                               "MS" => "MS",
                               "MG" => "MG",
                               "PA" => "PA",
                               "PB" => "PB",
                               "PR" => "PR",
                               "PE" => "PE",
                               "PI" => "PI",
                               "RJ" => "RJ",
                               "RN" => "RN",
                               "RS" => "RS",
                               "RO" => "RO",
                               "RR" => "RR",
                               "SC" => "SC",
                               "SP" => "SP",
                               "SE" => "SE",
                               "TO" => "TO"); ?>
<?php $arrayGenero = array('M' => 'Masculino', 'F' => 'Feminino'); ?>
<fieldset>
    <legend><b>Atualização de cliente</b></legend>
    <form action="?" method="POST">
        <input type="hidden" name="acao" value="atualizarCliente" />
        <input type="hidden" name="aba" value="2" />
        <input type="hidden" name="id" value="<?php echo $request->getParam('id') != '' ? $request->getParam('id') : $objClienteBO->getCliente()->getId() ?>" />
        
        <table id="tbCadastroCliente">
            <tr>
                <td>
                    <label for="nome">Nome:</label>
                    <input type="text" id="nome" name="nome" value="<?php echo $request->getParam('nome') != '' ? $request->getParam('nome') : $objClienteBO->getCliente()->getNome() ?>"/>

                </td>
                <td>
                    <label for="email">Email:</label>
                    <input type="email" id="email" name="email" value="<?php echo $request->getParam('email') != '' ? $request->getParam('email') : $objClienteBO->getCliente()->getEmail() ?>"/>
                </td>
                <td>
                    <label for="genero">Gênero:</label>
                    <select name="genero" id="genero">
                        <option value="">Selecione...</option>
                        <?php foreach ($arrayGenero as $key => $val): ?>
                        <option value="<?php echo $key; ?>" <?php echo $request->getParam('genero') == $key || $objClienteBO->getCliente()->getGenero() == $key ? 'selected' : ''; ?>><?php echo $val; ?></option>
                        <?php endforeach; ?>
                    </select>
                </td>
            </tr>
            <tr>
                <td>
                    <label for="telefone">Telefone:</label>
                    <input type="text" id="telefone" name="telefone" value="<?php echo $request->getParam('telefone') != '' ? $request->getParam('telefone') : $objClienteBO->getCliente()->getTelefone() ?>"/>
                </td>
                <td>
                    <label for="celular">Celular:</label>
                    <input type="text" id="celular" name="celular" value="<?php echo $request->getParam('celular') != '' ? $request->getParam('celular') : $objClienteBO->getCliente()->getCelular() ?>"/>
                </td>
            </tr>
            <tr>
                <td>
                     <label for="cidade">Cidade:</label>
                    <input type="text" id="cidade" name="cidade" value="<?php echo $request->getParam('cidade') != '' ? $request->getParam('cidade') : $objClienteBO->getCliente()->getCidade() ?>"/>
                </td>
                <td>
                    <label for="bairro">Bairro:</label>
                    <input type="text" id="bairro" name="bairro" value="<?php echo $request->getParam('bairro') != '' ? $request->getParam('bairro') : $objClienteBO->getCliente()->getBairro() ?>"/>
                </td>
                <td>
                    <label for="uf">UF:</label>
                    <select name="uf" id="uf">
                        <option value="">Selecione...</option>
                         <?php foreach ($arrayUf as $key => $val): ?>
                            <option value="<?php echo $key; ?>" <?php echo $request->getParam('uf') == $key || $objClienteBO->getCliente()->getUf() == $key ? 'selected' : ''; ?>><?php echo $val; ?></option>
                        <?php endforeach; ?>
                    </select>
                </td>
                <td>
                    <label for="cep">CEP:</label>
                    <input type="text" id="cep" name="cep" value="<?php echo $objClienteBO->getCliente()->getCep() ? $objClienteBO->getCliente()->getCep() : $request->getParam('cep');?>"/>
                </td>
            </tr>
             <tr>
                <td>
                    <label for="complemento">Complemento:</label>
                    <input type="text" id="complemento" name="complemento" value="<?php echo $request->getParam('complemento') != '' ? $request->getParam('complemento') : $objClienteBO->getCliente()->getComplemento() ?>"/>
                </td>
                <td>
                    <label for="nascimento">Nascimento:</label>
                    <input type="date" id="nascimento" name="nascimento" value="<?php echo $request->getParam('nascimento') != '' ? $request->getParam('nascimento') : $objClienteBO->getCliente()->getNascimento() ?>"/>
                </td>
             </tr>
        </table>
        <input class="btn btn-primary" type="submit" value="Atualizar" />
    </form>
</fieldset>